-
Notifications
You must be signed in to change notification settings - Fork 4
Improve Timer Precision Measurement #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modernizes timer precision measurement by removing the Boost Accumulators dependency and implementing Welford's online algorithm for stable statistical calculations. The changes ensure portable, monotonic timing across platforms with improved statistical rigor and better error handling.
Key changes:
- Replaced Boost Accumulators with a custom implementation using Welford's algorithm for mean/variance calculation
- Added compile-time clock selection to prefer high_resolution_clock only when monotonic, with fallback to steady_clock
- Enhanced statistical accuracy by computing proper 95% confidence intervals (z=1.96) and increasing sample size from 100 to 1000
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/timeprecision.hpp | Updated function signature to reflect new default sample size (1000) and documented filtering/termination behavior |
| src/timeprecision.cpp | Replaced Boost implementation with Welford's algorithm, added clock selection logic, implemented value filtering with >1ms threshold, and added program termination for insufficient samples |
| src/p11perftest.cpp | Enhanced output message to clarify that the interval represents a 95% confidence interval |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's reset release tagging - I prefer to keep this in a separate commit. The 3.15.1 was a mistake and It will be corrected through PR #21.
What changed:
Why:
Test (not bad for a VM):